<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script> 
        // 时间对象
        let date = new Date()
          
        console.log(date);
        // 获取年份
        console.log(date.getFullYear());
          // 获取月份 0-11
        console.log(date.getMonth()+1);
        // 获取日期 
        console.log(date.getDate());
        // 获取时
        console.log(date.getHours());
        // 获取分
        console.log(date.getMinutes());
         // 获取秒
         console.log(date.getSeconds());
        //  获取星期几 0周日 
        console.log(date.getDay());

        // 时间戳
        console.log(date.getTime());
        
        
      
        
    </script>
</body>
</html>